package org.example.fastproject.core.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author 王海舟
 * @Date 2023/1/5 11:29
 * @PackageName:org.example.store.common.config
 * @ClassName: MybatisPlusConfig
 * @Description: mybatis-plus配置类
 * @Version 1.0
 */
@Configuration
public class MybatisPlusConfig {
    /**
     * 配置分页
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

}
